home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-18 | 2.0 KB | 98 lines | [TEXT/MMCC] |
- //
- // CTCPSessionDocPP.cp
- //
- // TurboTCP library
- // TCP session document
- // PowerPlant-specific class
- //
- // Copyright © 1993-95, FrostByte Design / Eric Scouten
- //
-
- #include "CTCPSessionDocPP.h"
-
- #if !TurboTCP_PP
- #error: This file should be used with PowerPlant projects only!
- #endif
-
- #include <LWindow.h>
-
-
- //***********************************************************
-
- CTCPSessionDocPP::CTCPSessionDocPP
- (LCommander* inSuper,
- unsigned short theDefaultPort,
- unsigned long recBufferSize,
- unsigned short autoReceiveSize,
- unsigned short autoReceiveNum,
- Boolean doUseCName)
-
- : LSingleDoc(inSuper),
- CTCPEndpoint(theDefaultPort, recBufferSize, autoReceiveSize, autoReceiveNum, doUseCName)
-
- { }
-
-
- //***********************************************************
-
- CTCPSessionDocPP::CTCPSessionDocPP
- (unsigned short theDefaultPort,
- unsigned long recBufferSize,
- unsigned short autoReceiveSize,
- unsigned short autoReceiveNum,
- Boolean doUseCName)
-
- : CTCPEndpoint(theDefaultPort, recBufferSize, autoReceiveSize, autoReceiveNum, doUseCName)
- { }
-
-
- // -- closing windows & sessions --
-
- //***********************************************************
-
- void CTCPSessionDocPP::AttemptClose
- (Boolean inRecordIt)
-
- {
- if (LocalClose(false))
- LDocument::AttemptClose(inRecordIt);
- }
-
-
- //***********************************************************
-
- void CTCPSessionDocPP::RemoteClose()
-
- // Respond to notification that the remote host cancelled the session (either by normal
- // close or terminate).
-
- {
- Boolean sessionWasEstablished = SessionEstablished();
-
- CTCPEndpoint::RemoteClose();
- if ((goAwayOnClose) && (!sessionWasEstablished))
- LDocument::Close();
- }
-
-
- // –– window titling --
-
- //***********************************************************
-
- void CTCPSessionDocPP::GetFileName
- (Str255 theName) // returns the name of the file or window
-
- {
- GetDescriptor(theName);
- }
-
- //***********************************************************
-
- void CTCPSessionDocPP::SetWindowTitle
- (Str255 newTitle) // new window title
-
- {
- if (mWindow)
- mWindow->SetDescriptor(newTitle);
- }
-